home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / lib / linuxdoc-sgml / doc / guide.txt < prev    next >
Text File  |  1994-06-21  |  30KB  |  859 lines

  1.   Linuxdoc-SGML User's Guide
  2.   Matt Welsh, mdw@sunsite.unc.edu
  3.   v1.3, 7 June 1994
  4.  
  5.   This document is a user's guide to the linuxdoc-sgml formatting sys-
  6.   tem, an SGML-based text formatter which allows you to produce LaTeX,
  7.   plain ASCII, and HTML from a single source format. This guide docu-
  8.   ments Linuxdoc-SGML version 1.1.
  9.  
  10.   1.  Introduction
  11.  
  12.   This is a user's guide to the linuxdoc-sgml document processing
  13.   system, for use with Linux documentation. linuxdoc-sgml is an SGML DTD
  14.   (Document Type Definition) and set of ``replacement files'' which
  15.   convert the SGML to groff, LaTeX, and HTML source. In the future,
  16.   linuxdoc-sgml will support texinfo, as well as other formats.
  17.  
  18.   linuxdoc-sgml is based heavily on the QWERTZ DTD by Tom Gordon,
  19.   thomas.gordon@gmd.de. I have only made revisions to his DTD and
  20.   replacement files for use by Linux documentation.
  21.  
  22.   linuxdoc-sgml is not meant to be a general document-processing system.
  23.   Although it can be used for documents of many types, I have tailored
  24.   it for use by the Linux documentors in producing HOWTOs, FAQs, and
  25.   (later) the Linux Documentation Project manuals. Therefore, I have
  26.   tweaked features into and out of the system for this purpose. If you
  27.   see a lack of generality in the system, that is the reason. There's
  28.   nothing binding linuxdoc-sgml to Linux documentation, but all
  29.   documents produced by the system will look a certain way. If you want
  30.   things to look differently I suggest that you use a more generalized
  31.   system such as the plain QWERTZ DTD.
  32.  
  33.   One of the goals of this system is to make documents easy to produce
  34.   in numerous formats. Until now, most Linux documentation has been
  35.   produced in plain ASCII through manual editing. A system like groff
  36.   can take care of the plain-text formatting, but that still doesn't
  37.   give you HTML (for use on the World Wide Web), LaTeX (for nicely
  38.   printed documents), or texinfo. Therefore, if there are features
  39.   missing from this system that you would like, please let me know! The
  40.   idea is that we shouldn't have to use a lot of hackery to produce
  41.   good-looking docs in multiple formats.  The author should have to do
  42.   as little as possible.
  43.  
  44.  
  45.   1.1.  About this document
  46.  
  47.   This document is written using the linuxdoc-sgml DTD. It contains more
  48.   or less everything you need to know to write SGML docs with this DTD.
  49.   See example.sgml for an example of an SGML document that you can use
  50.   as a model for your own docs.
  51.  
  52.  
  53.   1.2.  Why SGML?
  54.  
  55.   I chose SGML for this system because SGML is made specifically for
  56.   translation to other formats. SGML, which stands for Standard
  57.   Generalized Markup Language, allows you to specify the structure of a
  58.   document---that is, what kinds of things make up the document. You
  59.   specify the structure of a document with a DTD (Document Type
  60.   Definition). linuxdoc-sgml is one DTD that specifies the structure for
  61.   Linux HOWTOs and other docs. QWERTZ is another DTD; the SGML standard
  62.   provides DTD's for books, articles, and other generic document types.
  63.  
  64.   The DTD specifies the names of ``elements'' within the document. An
  65.   element is just a bit of structure---like a section, a subsection, a
  66.   paragraph, or even something smaller like emphasised text. Unlike
  67.   LaTeX, however, these elements are not in any way intrinsic to SGML
  68.   itself. The linuxdoc-sgml DTD happens to define elements that look a
  69.   lot like their LaTeX counterparts---you have sections, subsections,
  70.   verbatim ``environments'', and so forth. However, using SGML you can
  71.   define any kind of structure for the document that you like. In a way,
  72.   SGML is like low-level TeX, while the linuxdoc-sgml DTD is like LaTeX.
  73.  
  74.   Don't be confused by this analogy. SGML is not a text-formatting
  75.   system.  There is no ``SGML formatter'' per se. SGML source is only
  76.   converted to other formats for processing. Furthermore, SGML itself is
  77.   used only to specify the document structure. There are no text-
  78.   formatting facilities or ``macros'' intrinsic to SGML itself. All of
  79.   those things are defined within the DTD. You can't use SGML without a
  80.   DTD---a DTD defines what SGML does.
  81.  
  82.  
  83.   1.3.  How it works
  84.  
  85.   Here's how processing a document with SGML and the linuxdoc-sgml DTD
  86.   works. First, you need a DTD. I'm using the QWERTZ DTD which was
  87.   produced, originally, by a group of people who needed a LaTeX-like
  88.   DTD. I've modified the QWERTZ DTD to produce the linuxdoc-sgml DTD for
  89.   our purposes.  The DTD simply sets up the structure of the document. A
  90.   small portion of it looks like this:
  91.  
  92.  
  93.        <!element article - -
  94.                (titlepag, header?,
  95.                 toc?, lof?, lot?, p*, sect*,
  96.                 (appendix, sect+)?, biblio?) +(footnote)>
  97.  
  98.  
  99.  
  100.  
  101.   This part sets up the overall structure for an ``article'', which is
  102.   like a ``documentstyle'' within LaTeX. The article consists of a
  103.   titlepage (titlepag), an optional header (header), an optional table
  104.   of contents (toc), optional lists of figures (lof) and tables (lot),
  105.   any number of paragraphs (p), any number of top-level sections (sect),
  106.   optional appendices (appendix), an optional bibliography (biblio) and
  107.   footnotes (footnote).
  108.  
  109.   As you can see, the DTD doesn't say anything about how the document
  110.   should be formatted or what it should look like. It just defines what
  111.   parts make up the document. Elsewhere in the DTD the structure of the
  112.   titlepag, header, sect, and other elements are defined.
  113.  
  114.   You don't need to know anything about the syntax of the DTD in order
  115.   to write documents. I'm just presenting it so you know what it looks
  116.   like and what it does. You do need to be familiar with the document
  117.   structure that the DTD defines. If not, you might violate the
  118.   structure when attempting to write a document, and be very confused
  119.   about the resulting error messages. We'll describe the structure of
  120.   linuxdoc-sgml documents in detail later.
  121.  
  122.   The next step is to write a document using the structure defined by
  123.   the DTD. Again, the linuxdoc-sgml DTD makes documents look a lot like
  124.   LaTeX---it's very easy to follow. In SGML jargon a single document
  125.   written using a particular DTD is known as an ``instance'' of that
  126.   DTD.
  127.  
  128.   In order to translate the SGML source into another format (such as
  129.   LaTeX or nroff) for processing, the SGML source (the document that you
  130.   wrote) is parsed along with the DTD by (you guessed it) the SGML
  131.   parser.  I'm using the sgmls parser by James Clark, jjc@jclark.com,
  132.   who also happens to be the author of groff. We're in good hands.  The
  133.   parser (the executable sgmls simply picks through your document and
  134.   verifies that it follows the structure set forth by the DTD. It also
  135.   spits out a more explicit form of your document, with all ``macros''
  136.   and elements expanded, which is understood by sgmlsasp, the next part
  137.   of the process.
  138.  
  139.   sgmlsasp is responsible for converting the output of sgmls to another
  140.   format (such as LaTeX). It does this using replacement files, which
  141.   describe how to convert elements in the original SGML document into
  142.   corresponding source in the ``target'' format (such as LaTeX or
  143.   nroff).
  144.  
  145.   For example, part of the replacement file for LaTeX looks like:
  146.  
  147.  
  148.        <itemize>       +       "\\begin{itemize}"      +
  149.        </itemize>      +       "\\end{itemize}"        +
  150.  
  151.  
  152.  
  153.  
  154.   Which says that whenever you begin an itemize element in the SGML
  155.   source, it should be replaced with
  156.  
  157.  
  158.        \begin{itemize}
  159.  
  160.  
  161.  
  162.  
  163.   in the LaTeX source. (As I said, elements in the linuxdoc-sgml DTD are
  164.   very similar to their LaTeX counterparts).
  165.  
  166.   So, to convert the SGML to another format, all you have to do is write
  167.   a new replacement file for that format that gives the appropriate
  168.   analogues to the SGML elements in that new format. In practice, it's
  169.   not that simple---for example, if you're trying to convert to a format
  170.   that isn't structured at all like your DTD, you're going to have
  171.   trouble. In any case, it's much easier to do than writing individual
  172.   parsers and translators for many kinds of output formats; SGML
  173.   provides a generalized system for converting one source to many
  174.   formats.
  175.  
  176.   Once sgmlsasp has completed its work, you have LaTeX source which
  177.   corresponds to your original SGML document, which you can format using
  178.   LaTeX as you normally would. Later in this document I'll give examples
  179.   and show the commands used to do the translation and formatting. You
  180.   can do this all on one command line.
  181.  
  182.   But first, I should describe how to install and configure the
  183.   software.
  184.  
  185.  
  186.   2.  Installation
  187.  
  188.   The file linuxdoc-sgml.tar.gz contains everything that you need to
  189.   write SGML documents and convert them to LaTeX, nroff, and HTML.  In
  190.   addition to this package, you will need one or both of the following:
  191.  
  192.   1. groff. You need version 1.08 or 1.09. Apparently some of the
  193.      margin-handling in groff is in a state of flux from version to
  194.      version; they both work, but you get slightly different results.
  195.      (Particularly, with 1.09 the left margin isn't indented two
  196.      characters as it is in 1.08. There is a way around it, but it looks
  197.      terrible on 1.08.  Versions previous to 1.08 will not work.  You
  198.      can get this from prep.ai.mit.edu in /pub/gnu. There is a Linux
  199.      binary version on sunsite as well.  You will need groff to produce
  200.      plain ASCII from your SGML docs.  (TeX/LaTeX will be used to
  201.      produce nicely-printed PostScript and .dvi).
  202.  
  203.   2. TeX and LaTeX. This is available more or less everywhere; you
  204.      should have no problem getting it and installing it (there is a
  205.      Linux binary distribution on sunsite). Of course, you only need
  206.      TeX/LaTeX if you want to format your SGML docs with LaTeX. So,
  207.      installing TeX/LaTeX is optional. See the section on the Linux
  208.      HOWTO project below for how we'll manage this vis-a-vis the Linux
  209.      HOWTOs.
  210.  
  211.   3. If you want to view the generated HTML, I suggest getting NCSA
  212.      Mosaic 2.2 or later.
  213.  
  214.      Neither of these are required by the SGML system, but I suggest
  215.      that you get one or the other in order to format your docs and
  216.      verify that they look all right before distributing them.
  217.  
  218.  
  219.   2.1.  Installing the software
  220.  
  221.   The steps needed to install and configure the linuxdoc-sgml stuff are
  222.   as follows:
  223.  
  224.  
  225.   1. First, unpack the tar file linuxdoc-sgml.tar.gz somewhere.  This
  226.      will create the directory linuxdoc-sgml where all of the SGML files
  227.      live. It doesn't matter where you unpack this file; just don't move
  228.      things around within the linuxdoc-sgml directory.
  229.  
  230.   2. Next, you need to compile the sgmls parser. In the linuxdoc-
  231.      sgml/sgmls-1.1 directory, issue the commands:
  232.  
  233.  
  234.        $ make config.h
  235.        $ make
  236.        $ make install
  237.        $ make install.man
  238.  
  239.  
  240.  
  241.  
  242.   This should compile the parser and translator, and place the binaries
  243.   sgmls, sgmlsasp, and rast in linuxdoc-sgml/bin.  I suggest that you
  244.   don't move those binaries from that location; instead, make symlinks
  245.   to them from /usr/local/bin or place linuxdoc-sgml/bin on your path.
  246.   (If you move things around within the linuxdoc-sgml tree you'll have
  247.   to edit a number of files to get everything to cooperate again. Best
  248.   to leave things as-is.)
  249.  
  250.   If things don't work try editing the Makefile in the sgmls-1.1 direc-
  251.   tory. I have it set to use gcc as the compiler, and use rather malig-
  252.   nant options. Compiles fine on Linux and sun-4 systems.
  253.  
  254.   This will also install man pages for the three binaries in linuxdoc-
  255.   sgml/man. You can move those or link them to your regular man page
  256.   tree, should you need them.
  257.  
  258.   3. Edit the variables at the top of the scripts format, qroff,
  259.      preroff, prehtml, and qtex in linuxdoc-sgml/bin.  All you really
  260.      need to edit is the value of the LINUXDOC shell variable which
  261.      gives the full pathname of the linuxdoc-sgml directory.
  262.  
  263.   4. In the html-fix directory, issue the commands:
  264.  
  265.   $ make
  266.   $ make install
  267.  
  268.  
  269.  
  270.  
  271.   This will build fixref and html2html, which are post processors for
  272.   the HTML conversion, and place them in the bin directory.
  273.  
  274.   If all went well, you should be ready to use the system. Just be sure
  275.   that linuxdoc-sgml/bin is on your path or you've linked the files
  276.   therein to your standard binary directories. Again, don't just copy
  277.   them somewhere else; the scripts expect to find each other in that
  278.   directory.
  279.  
  280.  
  281.   2.2.  Testing it out
  282.  
  283.   You can now test the system. The format script takes an SGML document
  284.   as input and translates it to a given format. The qtex script will
  285.   process the output of format using LaTeX, and qroff will process it
  286.   using nroff.
  287.  
  288.   Let's say you have the SGML document foo.sgml. You can translate it to
  289.   LaTeX, and produce PostScript output (via dvips) with the command:
  290.  
  291.  
  292.        $ format -Tlatex foo | qtex > foo.ps
  293.  
  294.  
  295.  
  296.  
  297.   Or, you can produce a DVI file using the -d switch with qtex, as so:
  298.  
  299.  
  300.        $ format -Tlatex foo | qtex -d > foo.dvi
  301.  
  302.  
  303.  
  304.  
  305.   If you want to produce plain ASCII, through groff, use the command:
  306.  
  307.  
  308.        $ format -Tnroff foo | qroff > foo.txt
  309.  
  310.  
  311.  
  312.  
  313.   Note that I have tailored the groff conversion for plain ASCII output.
  314.   (That is, I've removed page headers, page numbers, changed the mar-
  315.   gins, and so on.) With some hacking you can produce PostScript and DVI
  316.   from the groff resulting from format, but I suggest that you use LaTeX
  317.   for that instead.
  318.  
  319.   If you want to produce HTML, the procedure is a bit more complicated,
  320.   because of cross-references. Here's an example:
  321.  
  322.  
  323.        $ format -Thtml foo.sgml | prehtml | fixref > tmp.html
  324.        $ format -Thtml foo.sgml | prehtml >> tmp.html
  325.        $ cat tmp.html | html2html foo > foo.html
  326.        $ rm tmp.html
  327.  
  328.  
  329.  
  330.  
  331.   This will produce foo.html, as well as foo-1.html, foo-2.html, and so
  332.   on---one file for each section of the document.  Run your WWW client
  333.   on foo.html, which is the toplevel file.  Also make sure that all of
  334.   the HTML files corresponding to your document are in one directory, as
  335.   they reference each other with local URLs.
  336.  
  337.   A good way to test this would be to run it on this file, guide.sgml.
  338.  
  339.   If you just want to capture your errors from the SGML conversion, use
  340.   something like
  341.  
  342.  
  343.        $ format -Tnroff foo > /dev/null
  344.  
  345.  
  346.  
  347.  
  348.  
  349.   2.3.  Development note
  350.  
  351.  
  352.   The HTML conversion is, at this time, rudimentary but adequate. In the
  353.   future there will be support for cross-references, navigation buttons,
  354.   external URLs, and the like. Something is better than nothing. :)
  355.  
  356.   Also, if you'd like to help me implement a texinfo (or plain Info)
  357.   conversion for Linuxdoc-SGML, let me know! As with HTML we'll have to
  358.   do some pre- and post-processing (which you supposedly shouldn't need
  359.   with SGML, ah well), but that's not a big issue.
  360.  
  361.  
  362.   3.  Writing Documents with linuxdoc-sgml
  363.  
  364.   For the most part, writing documents using the linuxdoc DTD is very
  365.   simple, and somewhat like LaTeX. However, there are some caveats to
  366.   watch out for. In this section I'll give an introduction on writing
  367.   SGML docs.  See the file example.sgml for an SGML example document
  368.   (and tutorial) which you can use as a model when writing your own
  369.   docs. Here I'm just going to discuss the various features of SGML, but
  370.   the source is not very readable as an example. Instead, print out the
  371.   source (as well as the formatted output) for example.sgml so you have
  372.   a real live case to refer to.
  373.  
  374.  
  375.   3.1.  Basic concepts
  376.  
  377.   Looking at the source of the example document, you'll notice right off
  378.   that there are a number of ``tags'' marked within angle brackets (<
  379.   and >). A tag simply specifies the beginning or end of an element,
  380.   where an element is something like a section, a paragraph, a phrase of
  381.   italicized text, an item in a list, and so on. Using a tag is like
  382.   using a LaTeX command such as \item or \section{...}.
  383.  
  384.   As a simple example, to produce this boldfaced text, I typed
  385.  
  386.  
  387.        As a simple example, to produce <bf>this boldfaced text</bf>, ...
  388.  
  389.  
  390.  
  391.  
  392.   in the source. <bf> begins the region of bold text, and </bf> ends it.
  393.   Alternately, use can use the abbreviated form
  394.  
  395.  
  396.  
  397.   As a simple example, to produce <bf/this boldfaced text/, ...
  398.  
  399.  
  400.  
  401.  
  402.   which encloses the bold text within slashes. (Of course, you'll need
  403.   to use the long form if the enclosed text contains slashes, such as
  404.   the case with UNIX filenames).
  405.  
  406.   There are other things to watch out with respect to special characters
  407.   (that's why you'll notice all of these bizarre-looking ampersand
  408.   expressions if you look at the source; I'll talk about those shortly).
  409.  
  410.   In some cases, the end-tag for a particular element is optional. For
  411.   example, to begin a section, you use the <sect> tag, however, the end-
  412.   tag for the section (which could appear at the end of the section body
  413.   itself, not just after the name of the section!)  is optional and
  414.   implied when you start another section of the same depth.  In general
  415.   you needn't worry about these details; just follow the model used in
  416.   the tutorial (example.sgml), and feel free to ask me if you have any
  417.   questions about the particulars.
  418.  
  419.  
  420.   3.2.  Special characters
  421.  
  422.   Obviously, the angle brackets are themselves special characters in the
  423.   SGML source. There are others to watch out for. For example, let's say
  424.   that you wanted to type an expression with angle brackets around it,
  425.   as so: <foo>. In order to get the left angle bracket, you must use the
  426.   < element, which is a ``macro'' that expands to the actual left-
  427.   bracket character. Therefore, in the source, I typed
  428.  
  429.  
  430.        angle brackets around it, as so: <tt><foo></tt>.
  431.  
  432.  
  433.  
  434.  
  435.   Generally, something beginning with an ampersand is a special macro.
  436.   For example, there's &percnt to produce %, &verbar to produce |, and
  437.   so on. For all ``special characters'' there exist these ampersanded-
  438.   entities to represent them.
  439.  
  440.   Usually, you don't need to use the ampersand macro to get a special
  441.   character, however, in some cases it is necessary. The most commonly
  442.   used are:
  443.  
  444.   o  Use & for the ampersand (&),
  445.  
  446.   o  Use < for a left bracket (<),
  447.  
  448.   o  Use > for a right bracket (>),
  449.  
  450.   o  Use &etago; for a left bracket with a slash (</)
  451.  
  452.   o  Use $ for a dollar sign ($),
  453.  
  454.   o  Use # for a hash (#),
  455.  
  456.   o  Use % for a percent (%),
  457.  
  458.   o  Use `` and '' for quotes, or use &dquot for ".
  459.  
  460.  
  461.  
  462.  
  463.   3.3.  Verbatim and code environments
  464.  
  465.   While we're on the subject of special characters, I might as well
  466.   mention the verbatim ``environment'' used for including literal text
  467.   in the output (with spaces and indentation preserved, and so on). The
  468.   verb element is used for this; it looks like the following:
  469.  
  470.  
  471.        <verb>
  472.          Some literal text to include as example output.
  473.        </verb>
  474.  
  475.  
  476.  
  477.  
  478.   The verb environment doesn't allow you to use everything within it
  479.   literally. Specifically, you must do the following within verb envi-
  480.   ronments.
  481.  
  482.   o  Use &ero; to get an ampersand,
  483.  
  484.   o  Use &etago; to get </,
  485.  
  486.   o  Don't use \end{verbatim} within a verb environment, as this is what
  487.      LaTeX uses to end the verbatim environment. (In the future, it
  488.      should be possible to hide the underlying text formatter entirely,
  489.      but the parser doesn't support this feature yet.)
  490.  
  491.      The code environment is much just like the verb environment, except
  492.      that horizontal rules are added to the surrounding text, as so:
  493.  
  494.      ___________________________________________________________________
  495.      Here is an example code environment.
  496.      ___________________________________________________________________
  497.  
  498.  
  499.  
  500.   You should use the tscreen environment around any verb environments,
  501.   as so:
  502.  
  503.  
  504.        <tscreen><verb>
  505.        Here is some example text.
  506.        </verb></tscreen>
  507.  
  508.  
  509.  
  510.  
  511.   tscreen is an envionment that simply indents the text and sets the
  512.   sets the default font to tt. This makes examples look much nicer, both
  513.   in the LaTeX and plain ASCII versions. You can use tscreen without
  514.   verb, however, if you use any special characters in your example
  515.   you'll need to use both of them. tscreen does nothing to special char-
  516.   acters. See example.sgml for examples.
  517.  
  518.   The quote environment is like tscreen, except that it does not set the
  519.   default font to tt. So, you can use quote for non-computer-interaction
  520.   quotes, as in:
  521.  
  522.  
  523.        <quote>
  524.        Here is some text to be indented, as in a quote.
  525.        </quote>
  526.  
  527.  
  528.  
  529.   which will generate:
  530.  
  531.        Here is some text to be indented, as in a quote.
  532.  
  533.  
  534.  
  535.   3.4.  Overall document structure
  536.  
  537.   Before we get too in-depth with details, I'm going to describe the
  538.   overall structure of a document as defined by the linuxdoc DTD.  Look
  539.   at example.sgml for a good example of how a document is set up.
  540.  
  541.  
  542.   3.4.1.  The preamble
  543.  
  544.   In the document ``preamble'' you set up things such as the title
  545.   information and document style. For a Linux HOWTO document this should
  546.   look like:
  547.  
  548.  
  549.        <!doctype linuxdoc system>
  550.  
  551.        <article>
  552.  
  553.        <title>The Linux Food-Processing HOWTO
  554.        <author>Norbert Ebersol, <tt/norbert@foo.com/
  555.        <date>v1.0, 9 March 1994
  556.        <abstract>
  557.        This document describes how to connect your Linux machine to a food-processor
  558.        for dicing vegetables.
  559.        </abstract>
  560.  
  561.        <toc>
  562.  
  563.  
  564.  
  565.  
  566.   The elements should go more or less in this order. The first line
  567.   tells the SGML parser to use the linuxdoc DTD. The <article> tag
  568.   forces the document to use the ``article'' document style. (The
  569.   original QWERTZ DTD defines ``report'' and ``book'' as well; I haven't
  570.   tweaked these for use with linuxdoc-sgml. Just use article for you
  571.   SGML docs, for now.)
  572.  
  573.   The title, author, and date tags should be obvious; in the date tag
  574.   include the version number and last modification time of the document.
  575.  
  576.   Thr abstract tag sets up the text to be printed at the top of the
  577.   document, before the table of contents. If you're not going to include
  578.   a table of contents (the toc tag), you probably don't need an
  579.   abstract. I suggest that all Linux HOWTOs use this same format for the
  580.   preamble, so that the title, abstract, and table of contents are all
  581.   there and look the same.
  582.  
  583.  
  584.   3.4.2.  Sectioning and paragraphs
  585.  
  586.   After the preamble, you're ready to dive into the document. The
  587.   following sectioning commands are available:
  588.  
  589.   o  sect: For top-level sections (i.e. 1, 2, and so on.)
  590.  
  591.   o  sect1: For second-level subsections (i.e. 1.1, 1.2, and so on.)
  592.  
  593.   o  sect2: For third-level subsubsections.
  594.  
  595.   o  sect3: For fourth-level subsubsubsections.
  596.  
  597.   o  sect4: For fifth-level subsubsubsubsections.
  598.  
  599.      These are roughly equivalent to their LaTeX counterparts section,
  600.      subsection, and so on.
  601.  
  602.   After the sect (or sect1, sect2, etc.) tag comes the name of the
  603.   section. For example, at the top of this document, after the preamble,
  604.   comes the tag:
  605.  
  606.  
  607.        <sect>Introduction
  608.  
  609.  
  610.  
  611.  
  612.   And at the beginning of this section (Sectioning and paragraphs),
  613.   there is the tag:
  614.  
  615.  
  616.        <sect2>Sectioning and paragraphs
  617.  
  618.  
  619.  
  620.  
  621.   After the section tag, you begin the body of the section. However, you
  622.   must start the body with a <p> tag, as so:
  623.  
  624.  
  625.        <sect>Introduction
  626.  
  627.        <p>
  628.        This is a user's guide to the <tt/linuxdoc-sgml/ document processing...
  629.  
  630.  
  631.  
  632.  
  633.   This is to tell the parser that you're done with the section title and
  634.   are ready to begin the body. Thereafter, new paragraphs are started
  635.   with a blank line (just as you would do in TeX). For example,
  636.  
  637.  
  638.        Here is the end of the first paragraph.
  639.  
  640.        And we start a new paragraph here.
  641.  
  642.  
  643.  
  644.  
  645.   There is no reason to use <p> tags at the beginning of every para-
  646.   graph; only at the beginning of the first paragraph after a sectioning
  647.   command.
  648.  
  649.  
  650.   3.4.3.  Ending the document
  651.  
  652.   At the end of the document, you must use the tag:
  653.  
  654.  
  655.        </article>
  656.  
  657.  
  658.  
  659.  
  660.  
  661.   to tell the parser that you're done with the article element (which
  662.   embodies the entire document).
  663.  
  664.  
  665.   3.5.  Cross-references
  666.  
  667.   Now we're going to move onto other features of the system.  Cross-
  668.   references are easy. For example, if you want to make a cross-
  669.   reference to a certain section, you need to label that section as so:
  670.  
  671.  
  672.        <sect1><heading><label id="sec-intro">Introduction</>
  673.  
  674.  
  675.  
  676.  
  677.   You can then refer to that section somewhere in the text using the
  678.   expression:
  679.  
  680.  
  681.        See section <ref id="sec-intro" name="Introduction"> for an introduction.
  682.  
  683.  
  684.  
  685.  
  686.   This will replace the ref tag with the section number labelled as sec-
  687.   intro. The name argument to ref is necessary for nroff and HTML trans-
  688.   lations (at the moment). The nroff macro set used by Linuxdoc-SGML
  689.   does not currently support cross-references, and it's often nice to
  690.   refer to a section by name instead of number.
  691.  
  692.   For example, this section is ``Cross-references''.
  693.  
  694.   There is also a url element for Universal Resource Locators, or URLs,
  695.   used on the World Wide Web. This element should be used to refer to
  696.   other documents, files available for FTP, and so forth. For example,
  697.  
  698.  
  699.        You can get the Linux HOWTO documents from
  700.        <url url="http://sunsite.unc.edu/mdw/linux.html"
  701.             name="the Linux Documentation Project home page">.
  702.  
  703.  
  704.  
  705.  
  706.   The url argument specifies the actual URL itself. A link to the URL in
  707.   question will be automatically added to the HTML document.  The
  708.   optional name argument specifies the text that should be anchored to
  709.   the URL (for HTML conversion) or named as the description of the URL
  710.   (for LaTeX and nroff). If no name argument is given, the URL itself
  711.   will be used.
  712.  
  713.   For example, you can get the Linuxdoc-SGML package from
  714.   (ftp://ftp.cs.cornell.edu/mdw/linuxdoc-sgml-1.1.tar.gz).
  715.  
  716.  
  717.   3.6.  Fonts
  718.  
  719.   Essentially, the same fonts supported by LaTeX are supported by
  720.   linuxdoc-sgml. Note, however, that the conversion to plain ASCII
  721.   (through groff) does away with the font information---I might hack up
  722.   plain-ASCII representations of the various fonts if the need arises.
  723.   So, you should use fonts as much as possible, for the benefit of the
  724.   conversion to LaTeX.  But don't depend on the fonts to get a point
  725.   across in the plain ASCII version.
  726.  
  727.   In particular, the tt tag described above can be used to get constant-
  728.   width ``typewriter'' font which should be used for all e-mail
  729.   addresses, machine names, filenames, and so on.  Example:
  730.  
  731.  
  732.        Here is some <tt>typewriter text</tt> to be included in the document.
  733.  
  734.  
  735.  
  736.  
  737.   Equivalently:
  738.  
  739.  
  740.        Here is some <tt/typewriter text/ to be included in the document.
  741.  
  742.  
  743.  
  744.  
  745.   Remember that you can only use this abbreviated form if the enclosed
  746.   text doesn't contain slashes.
  747.  
  748.   Other fonts can be achieved with bf for boldface and em for italics.
  749.   Several other fonts are supported as well, but I don't suggest you use
  750.   them, because we'll be converting these documents to other formats
  751.   such as HTML which may not support them.  Boldface, typewriter, and
  752.   italics should be all that you need.
  753.  
  754.  
  755.   3.7.  Lists
  756.  
  757.   There are various kinds of supported lists. They are:
  758.  
  759.   o  itemize for bulleted lists such as this one.
  760.  
  761.   o  enum for numbered lists.
  762.  
  763.   o  descrip for ``descriptive'' lists.
  764.  
  765.      Each item in an itemize or enum list must be marked with an item
  766.      tag. Items in a descrip are marked with tag.  For example,
  767.  
  768.  
  769.        <itemize>
  770.        <item>Here is an item.
  771.        <item>Here is a second item.
  772.        </itemize>
  773.  
  774.  
  775.  
  776.  
  777.   Looks like this:
  778.  
  779.   o  Here is an item.
  780.  
  781.   o  Here is a second item.
  782.  
  783.      Or, for an enum,
  784.  
  785.  
  786.        <enum>
  787.        <item>Here is the first item.
  788.        <item>Here is the second item.
  789.        </enum>
  790.  
  791.  
  792.  
  793.   You get the idea. Lists can be nested as well; see the example docu-
  794.   ment for details.
  795.  
  796.   A descrip list is slightly different, and slightly ugly, but you might
  797.   want to use it for some situations:
  798.  
  799.  
  800.        <descrip>
  801.        <tag/Gnats./ Annoying little bugs that fly into your cooling fan.
  802.        <tag/Gnus./ Annoying little bugs that run on your CPU.
  803.        </descrip>
  804.  
  805.  
  806.  
  807.  
  808.   ends up looking like:
  809.  
  810.      Gnats.
  811.         Annoying little bugs that fly into your cooling fan.
  812.  
  813.      Gnus.
  814.         Annoying little bugs that run on your CPU.
  815.  
  816.  
  817.   3.8.  Miscellany
  818.  
  819.   There are various other esoteric features in the system as well, most
  820.   of which you probably won't use. If you're curious, read the QWERTZ
  821.   User's Guide (from ftp.cs.cornell.edu in pub/mdw/SGML).  QWERTZ (and
  822.   hence, linuxdoc) supports many features such as mathematical formulae,
  823.   tables, figures, and so forth. I don't recommend using most of these
  824.   features in the Linux HOWTOs because they won't render well in plain
  825.   ASCII. If you'd like to write general documentation in SGML, I suggest
  826.   using the original QWERTZ DTD instead of the hacked-up linuxdoc DTD,
  827.   which I've modified for use particularly by the Linux HOWTOs and other
  828.   documentation.
  829.  
  830.   The bottom line is, linuxdoc-sgml supports many other features found
  831.   in the QWERTZ DTD, but I haven't necessarily tweaked them to work well
  832.   with linuxdoc-sgml. If you encounter problems with any of them, please
  833.   let me know.
  834.  
  835.  
  836.   4.  The Linux HOWTO project
  837.  
  838.   How does this tie into writing HOWTOs? First of all, I'd like to see
  839.   everyone eventually convert their HOWTOs to SGML using this DTD. This
  840.   has a number of advantages. First of all, it will allow you to just
  841.   send me the SGML source, which I'll convert to plain ASCII, TeX,
  842.   whatever, for posting and archiving. Also, it will give the HOWTOs a
  843.   common look and feel; any changes that I make to the DTD will be
  844.   reflected in all of the HOWTOs.
  845.  
  846.   I have set up the linuxdoc DTD to have a certain look and feel.  If
  847.   you want your document to look differently, please let me know,
  848.   because I'll need to make those changes in the DTD itself. That is, do
  849.   not modify your version of the DTD or replacement files to get other
  850.   features in the system. We all must use the same DTD and replacement
  851.   files or this whole system will break down. If you find bugs in it, or
  852.   have suggestions for how we can change thing or add/modify features,
  853.   let me know. I'll be more than happy to accomodate you.
  854.  
  855.  
  856.  
  857.  
  858.  
  859.